<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/taglib_include.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, target-densitydpi=medium-dpi, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5, user-scalable=no" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<link href="${ctx}/css/main.css?ver=${main_css_version}" rel="stylesheet" type="text/css" />
<style type="text/css">
  @media screen and (max-width: 640px){
    #tip-r {
      font-size:17pt;
    }
  }
</style>
<title>${projectTitle }</title>
</head>
<body>
  <header id="main-top">
    <a href="${ctx}/login/index.do" style="visibility: hidden;">
      <div id="main-top-left">
        <img src="${ctx}/images/mui_title_back_btn.png" class="img-2">
      </div>
    </a>
    <div id="main-top-title">更新个人信息</div>
  </header>
  <div id="container">
    <div id="login">
        <ul>
          <li></li>
          <li><label>手机号码</label>
          <input class="loginInput" type="text" name="mobile" id="mobile" placeholder="请填写手机号码"/></li>
        </ul>
      <div id="tip-r">点击"下一步"按钮，您的手机将收到验证码，有效期300秒</div>
    </div>

    <a href="javascript:void(0);" id="next">
      <div id="determine" style="letter-spacing: 0pt;">下一步</div>
    </a>
  </div>
  <script type="text/javascript" src="${ctx}/js/jquery.min.js?ver=${jquery_min_version}"></script>
  <script type="text/javascript">
  $(document).ready(function() {
      $("#determine").bind("click", function(e) {
          var mobile = $("#mobile").val();

          if(mobile == ""){
               alert("手机号码不能为空");
               return false;
          }

          if(!/^\d{11}$/i.test(mobile)){
              alert("手机号码输入有误");
              return false;
          } 

          $.ajax({
              type: "POST",
              url:"${ctx}/authenticode/sendcaptcha.do",
              data:{mobile:mobile},
              success:function (data){
                  if(data.errcode == 0){
                      window.location.href = "${ctx}/userinfo/edit.do?mobile=" + mobile;
                  }else{
                     alert(data.errmsg);
                  }            
              }
          });
      });

      $("body").bind("keyup",function(e){
    	  // 前往键或者GO键的keycode
    	  if (e.keyCode == 13) {
    		  $("#determine").trigger("click");
    	  }
      });
  });
  </script>
</body>
</html>